package week1.day5;

/**
 * @Author fengzihao
 * @Date 2024-04-19 19:57
 */
public class TeacherTest {
    public static void main(String[] args) {
        Teacher t1 = new Teacher("张三", 18, "男", 1);
        Teacher t2 = new Teacher("李四", 25, "女", 2);
        t1.print();
        t2.print();
    }
}

class Teacher {
    public String name;
    public int age;
    public String gender;
    public int teacherId;

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Teacher() {

    }

    public Teacher(String name) {
        this.name = name;
    }

    public Teacher(String name, int teacherId) {
        this.name = name;
        this.teacherId = teacherId;
    }

    public Teacher(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public Teacher(String name, int age, String gender, int teacherId) {
        this(name, age, gender);
        this.teacherId = teacherId;
    }

    public void print() {
        System.out.println(this);
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", teacherId=" + teacherId +
                '}';
    }
}